home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Open Transport / Sample Code / NetFractal™ / ES stuff□ / APane.cpp next >
Encoding:
Text File  |  1996-11-19  |  662 b   |  51 lines  |  [TEXT/MPCC]

  1. //    APane.cpp
  2.  
  3.  
  4. #include <Timer.h>
  5.  
  6. #include "APane.h"
  7. #include "ScreenTarget.h"
  8.  
  9. APane *
  10. APane::CreateAPaneStream(
  11.     LStream *stream)
  12. {
  13.     return new APane(stream);
  14. }
  15.  
  16.  
  17. void
  18. APane::FinishCreate()
  19. {
  20.     theTarget = new ScreenTarget(GetMacPort());
  21. }
  22.  
  23.  
  24. void
  25. APane::SetData(
  26.     void *data,
  27.     long rowBytes,
  28.     long width,
  29.     long height,
  30.     long hPos,
  31.     long vPos)
  32. {
  33.     theData = data;
  34.     tWidth = width;
  35.     tRowBytes = rowBytes;
  36.     tHeight = height;
  37.     tHPos = hPos;
  38.     tVPos = vPos;
  39.     theTarget->PutData(theData, tRowBytes, tWidth, tHeight, tVPos, tHPos);
  40. }
  41.  
  42.  
  43. void
  44. APane::DrawSelf()
  45. {
  46.     if (theTarget && theData) {
  47.         theTarget->PutData(theData, tRowBytes, tWidth, tHeight, tVPos, tHPos);
  48.     }
  49. }
  50.  
  51.